//
//  TopicSlowFinderViewController.m
//  A段项目,漫画
//
//  Created by dlios on 15-4-22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "TopicSlowFinderViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface TopicSlowFinderViewController ()
@property(nonatomic, retain)UIWebView *myWeb;
@end

@implementation TopicSlowFinderViewController
-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
//    [self creatView];
    self.myWeb = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    [self.view addSubview:self.myWeb];
    self.myWeb.backgroundColor = [UIColor greenColor];
    NSLog(@"aadaw%@",self.special_event_url);
    NSURL *url = [NSURL URLWithString:self.special_event_url];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    self.myWeb.delegate = self;
    [self.myWeb loadRequest:request];
    [self.view addSubview:self.myWeb];
}

#pragma mark 创建视图
-(void)creatView
{
    self.topicFinderView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT) style:UITableViewStylePlain];
    [self.view addSubview:self.topicFinderView];
    [_topicFinderView release];
    
    self.topicFinderView.rowHeight = HEIGHT * 2;
    
    self.topicFinderView.delegate = self;
    self.topicFinderView.dataSource =self;
}


#pragma mark 实现协议的两个方法
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *reuse = @"reuse";
    TopicSlowFinderCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse];
    if (cell == nil) {
        cell = [[[TopicSlowFinderCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuse]autorelease];
    }
    
    [cell.topSlowFinderView loadHTMLString:self.special_event_url baseURL:nil];
    
    return cell;
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
